home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / locald / localdim.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-10-08  |  21.5 KB  |  634 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   6525
  5.    ClientLeft      =   90
  6.    ClientTop       =   720
  7.    ClientWidth     =   9435
  8.    Height          =   7365
  9.    Left            =   -45
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   6525
  12.    ScaleWidth      =   9435
  13.    Top             =   15
  14.    Width           =   9705
  15.    Begin CommandButton Command4 
  16.       Caption         =   "Cancel"
  17.       Height          =   495
  18.       Left            =   4500
  19.       TabIndex        =   20
  20.       Top             =   2520
  21.       Width           =   1215
  22.    End
  23.    Begin PictureBox Picture1 
  24.       Height          =   6375
  25.       Left            =   0
  26.       ScaleHeight     =   6345
  27.       ScaleWidth      =   9345
  28.       TabIndex        =   11
  29.       Top             =   0
  30.       Visible         =   0   'False
  31.       Width           =   9375
  32.       Begin CommandButton Command3 
  33.          Caption         =   "Close"
  34.          Height          =   495
  35.          Left            =   8400
  36.          TabIndex        =   17
  37.          Top             =   5760
  38.          Width           =   855
  39.       End
  40.       Begin Label Label13 
  41.          Caption         =   "While the file is loading, you will see the number of lines processed counting up.  That count will start over for a 2nd pass, and the list boxes will load when the second pass is completed.  Click on the sub or function that you want to view, and the variable list boxes will load with the data from the sub or function that you selected.  You can run this program from outside of VB, unmaximize the form, tuck it over on the right side of your screen, load VB, and then have this program available on the right while you trim unneeded declarations from your subs and functions on the left."
  42.          Height          =   1215
  43.          Left            =   180
  44.          TabIndex        =   19
  45.          Top             =   3000
  46.          Width           =   9135
  47.       End
  48.       Begin Label Label12 
  49.          Caption         =   "The code, I know, is quite messy.  No excuses, I wrote it in one draft, it has served my purpose, and I have no more time to spend on it.  No guarantees, either, but the program only reads files.  It won't write to any files.  If you can tidy things up and find a bug and improve the interface and add features, please upload your version and tell everybody else.   Thanks."
  50.          Height          =   975
  51.          Left            =   60
  52.          TabIndex        =   18
  53.          Top             =   5340
  54.          Width           =   8115
  55.       End
  56.       Begin Label Label11 
  57.          Caption         =   "I would also love to find a VB cross-reference tool that will locate globally-declared variables, and list the globally-declared variables that are only referenced in one module.  That way, you would then be able to declare those variables at the module-level.       I would ALSO love to have a tool that will allow you to take a sub or function, and list the module-declared variables used in that sub or function, and list the globally-declared variables used in that sub or function.  Anybody know of a tool like that?"
  58.          Height          =   1155
  59.          Left            =   120
  60.          TabIndex        =   16
  61.          Top             =   4260
  62.          Width           =   9135
  63.       End
  64.       Begin Label Label10 
  65.          Caption         =   "When you write a large VB program, sometimes you wind up with locally-declared variables that are no longer being used in the subs and functions in which they reside.  I haven't been able to find a utility that will locate those for me, EASILY, so I wrote this."
  66.          Height          =   615
  67.          Left            =   180
  68.          TabIndex        =   15
  69.          Top             =   540
  70.          Width           =   9135
  71.       End
  72.       Begin Label Label9 
  73.          Caption         =   "This program will take a VB module, a .FRM or a .BAS, and go through the module,  locating the subs and functions.  It will identify the locally-declared variables in the subs and functions, and will find the locally-declared variables that are NOT USED in the subs and functions in which they reside.  That will allow you to delete the variable declaration line (after you CONFIRM that the variable isn't referenced in the sub or function by using the Find tool, of course).  There are a few bugs in the program -- sometimes the variables listed aren't listed for the correct sub or function -- they're one sub off on the list, sometimes when reading a module, many lines are taken in on one input statement, and  a line like ""Dim x, y as integer"" won't register the y as a variable.   "
  74.          Height          =   1575
  75.          Left            =   180
  76.          TabIndex        =   14
  77.          Top             =   1260
  78.          Width           =   9135
  79.       End
  80.       Begin Label Label8 
  81.          Caption         =   "If you have comments, please contact me on CompuServe, 71630,1265."
  82.          Height          =   615
  83.          Left            =   3420
  84.          TabIndex        =   13
  85.          Top             =   60
  86.          Width           =   3255
  87.       End
  88.       Begin Label Label7 
  89.          Caption         =   "Programmed by Steve Denenberg"
  90.          Height          =   315
  91.          Left            =   180
  92.          TabIndex        =   12
  93.          Top             =   60
  94.          Width           =   3075
  95.       End
  96.    End
  97.    Begin CommonDialog CMDialog1 
  98.       Filter          =   "Modules and Forms|*.bas;*.frm|All files (*.*)|*.*"
  99.       InitDir         =   "c:\"
  100.       Left            =   4680
  101.       Top             =   3060
  102.    End
  103.    Begin ListBox listunusedvars 
  104.       Height          =   3345
  105.       Left            =   60
  106.       TabIndex        =   6
  107.       Top             =   2520
  108.       Width           =   2055
  109.    End
  110.    Begin ListBox listvariablenames 
  111.       Height          =   4905
  112.       Left            =   2400
  113.       TabIndex        =   3
  114.       Top             =   960
  115.       Width           =   1935
  116.    End
  117.    Begin CommandButton Command2 
  118.       Caption         =   "End"
  119.       Height          =   495
  120.       Left            =   4500
  121.       TabIndex        =   2
  122.       Top             =   840
  123.       Width           =   1215
  124.    End
  125.    Begin ListBox listsubname 
  126.       Height          =   1200
  127.       Left            =   60
  128.       Sorted          =   -1  'True
  129.       TabIndex        =   1
  130.       Top             =   720
  131.       Width           =   2055
  132.    End
  133.    Begin CommandButton Command1 
  134.       Caption         =   "Load file"
  135.       Height          =   495
  136.       Left            =   4500
  137.       TabIndex        =   0
  138.       Top             =   240
  139.       Width           =   1215
  140.    End
  141.    Begin Label Label6 
  142.       Height          =   315
  143.       Left            =   60
  144.       TabIndex        =   10
  145.       Top             =   0
  146.       Width           =   2115
  147.    End
  148.    Begin Label Label5 
  149.       Caption         =   "Sub or Function name"
  150.       Height          =   255
  151.       Left            =   60
  152.       TabIndex        =   9
  153.       Top             =   420
  154.       Width           =   2055
  155.    End
  156.    Begin Label Label4 
  157.       Caption         =   "All variables"
  158.       Height          =   255
  159.       Left            =   2400
  160.       TabIndex        =   8
  161.       Top             =   600
  162.       Width           =   1275
  163.    End
  164.    Begin Label Label3 
  165.       Caption         =   "UNUSED variables"
  166.       Height          =   255
  167.       Left            =   60
  168.       TabIndex        =   7
  169.       Top             =   2220
  170.       Width           =   1815
  171.    End
  172.    Begin Label Label2 
  173.       Caption         =   "lines read:"
  174.       Height          =   255
  175.       Left            =   4800
  176.       TabIndex        =   5
  177.       Top             =   1500
  178.       Width           =   975
  179.    End
  180.    Begin Label Label1 
  181.       Caption         =   "0"
  182.       Height          =   315
  183.       Left            =   4800
  184.       TabIndex        =   4
  185.       Top             =   1740
  186.       Width           =   1035
  187.    End
  188.    Begin Menu aboutitem 
  189.       Caption         =   "About"
  190.    End
  191. Option Explicit
  192. Option Compare Text
  193. Dim lineoftext(200) As String
  194. Dim fileend As Integer
  195. Dim filetoopen As String
  196. Dim bodyindex As Integer
  197. Dim variable(50, 200, 1) As String
  198. 'first parameter is the sub or function number
  199. 'second parameter lists the variables that are locally-declared
  200. 'if third parameter=0, the string is the name of the variable
  201. 'if third parameter=1, the string= "u" if the variable is used in
  202. '  the sub or function.
  203. Dim doublequote As String * 1
  204. Dim variableindex As Integer
  205. Dim subnumber As Integer
  206. Dim linesread As Integer
  207. Dim z%
  208. Dim cancelread As Integer
  209. Sub aboutitem_Click ()
  210. picture1.Left = 0
  211. picture1.Top = 0
  212. picture1.ZOrder
  213. picture1.Visible = True
  214. End Sub
  215. Sub Command1_Click ()
  216. Dim stringa As String
  217. Dim cc As Integer
  218. On Error GoTo errorhere
  219. fileend = False
  220. cancelread = False
  221. Erase variable
  222. listsubname.Clear
  223. listunusedvars.Clear
  224. listvariablenames.Clear
  225. cmdialog1.Action = 1
  226. filetoopen = cmdialog1.Filename
  227. label6.Caption = filetoopen
  228. label6.Refresh
  229. loadlinesoftext
  230. If cancelread Then
  231.     listsubname.Clear
  232.     listunusedvars.Clear
  233.     listvariablenames.Clear
  234.     Exit Sub
  235. End If
  236. On Error GoTo 0
  237. For cc = 0 To subnumber - 1
  238. listsubname.AddItem variable(cc, 0, 0)
  239. Next cc
  240. listsubname.Refresh
  241. loadunusedvariables
  242. getout:
  243. Exit Sub
  244. errorhere:
  245. Resume getout
  246. End Sub
  247. Sub Command2_Click ()
  248. End Sub
  249. Sub Command3_Click ()
  250. picture1.Visible = False
  251. End Sub
  252. Sub Command4_Click ()
  253. cancelread = True
  254. End Sub
  255. Sub findunusedvariables (theline As String)
  256. Dim cc As Integer
  257. Dim saveit As String
  258. Dim maxvariable As Integer
  259. Dim firstcomma As Integer
  260. Dim firstspace As Integer
  261. Dim firstparen As Integer
  262. Dim firstparenc As Integer
  263. Dim firstperiod As Integer
  264. ReDim varsthisline(1000) As String
  265. Dim varsthislineindex As Integer
  266. Dim dd As Integer
  267. Dim ee As Integer
  268. 'find the highest index of variable(subnumber , ??, 0).  That tells
  269. '  how many variables were found that were declared in subroutine #subnumber.
  270. For cc = 1 To 200
  271. If variable(subnumber, cc, 0) = "" Then
  272.     maxvariable = cc - 1
  273.     Exit For
  274. End If
  275. Next cc
  276. saveit = theline
  277. 'a word ends at a space, at an open parenthesis, at a comma, at a close
  278. '  parenthesis, or at a period
  279. varsthislineindex = 0
  280. saveit = Trim$(saveit)
  281. firstspace = InStr(saveit, " ")
  282. firstcomma = InStr(saveit, ",")
  283. firstparen = InStr(saveit, "(")
  284. firstparenc = InStr(saveit, ")")
  285. firstperiod = InStr(saveit, ".")
  286. 'find the first spot that a word ender occurs
  287. z% = min5(firstspace, firstcomma, firstparen, firstparenc, firstperiod)
  288. If z% = 0 Then Exit Do
  289. 'trim the variable out of the string, store it
  290. varsthisline(varsthislineindex) = Left$(saveit, z% - 1)
  291. varsthislineindex = varsthislineindex + 1
  292. 'trim the variable out of the string that is being processed
  293. saveit = Right$(saveit, Len(saveit) - z%)
  294. 'get to here, have varsthislineindex-1 variables on the line
  295. For dd = 0 To varsthislineindex - 1
  296. For ee = 1 To maxvariable
  297. If variable(subnumber, ee, 0) = varsthisline(dd) Then
  298.     variable(subnumber, ee, 1) = "u"
  299. End If
  300. Next ee
  301. Next dd
  302. End Sub
  303. Sub findvariablenames ()
  304. Dim cc As Integer
  305. Dim saveit As String
  306. variableindex = 1
  307. 'cycle through the linesoftext, and store the variable names.
  308. For cc = 0 To bodyindex - 1
  309. saveit = lineoftext(cc)
  310. 'skip if the line is blank
  311. If lineoftext(cc) = "" Then GoTo nextcc
  312. 'skip if the line begins with a comment
  313. If Left$(lineoftext(cc), 1) = "'" Then GoTo nextcc
  314. If Left$(lineoftext(cc), 3) = "rem" Then GoTo nextcc
  315. 'see if it is a dim, redim, static.  If so, work with the line.
  316. If Left$(lineoftext(cc), 4) = "dim " Then
  317.     lineoftext(cc) = Right$(lineoftext(cc), Len(lineoftext(cc)) - 4)
  318.     GoTo getem
  319. End If
  320. If Left$(lineoftext(cc), 6) = "redim " Then
  321.     lineoftext(cc) = Right$(lineoftext(cc), Len(lineoftext(cc)) - 6)
  322.     GoTo getem
  323. End If
  324. If Left$(lineoftext(cc), 7) = "static " Then
  325.     lineoftext(cc) = Right$(lineoftext(cc), Len(lineoftext(cc)) - 7)
  326.     GoTo getem
  327. End If
  328. GoTo nextcc
  329. getem:
  330. 'find the variables in the line
  331. 'strip double quotes
  332. lineoftext(cc) = stripquotes(lineoftext(cc))
  333. 'strip everything to the right of an apostrophe
  334. lineoftext(cc) = Left$(lineoftext(cc), Len(lineoftext(cc)) - InStr(lineoftext(cc), "'"))
  335. 'strip parentheses
  336. lineoftext(cc) = stripparentheses(lineoftext(cc))
  337. 'obtain the first variable
  338. Dim spacelocation As Integer
  339. lineoftext(cc) = lineoftext(cc) + " "
  340. spacelocation = InStr(lineoftext(cc), " ")
  341. variable(subnumber, variableindex, 0) = Left$(lineoftext(cc), spacelocation - 1)
  342. variableindex = variableindex + 1
  343. 'other variables will be just after commas
  344. Dim commalocation As Integer
  345. Dim startlooking As Integer
  346. startlooking = 1
  347. commalocation = InStr(startlooking, lineoftext(cc), ",")
  348. If commalocation = 0 Then
  349.         GoTo nextcc
  350.     Else
  351.         lineoftext(cc) = Right$(lineoftext(cc), Len(lineoftext(cc)) - commalocation)
  352.         lineoftext(cc) = Trim$(lineoftext(cc)) + " "
  353.         spacelocation = InStr(lineoftext(cc), " ")
  354.         variable(subnumber, variableindex, 0) = Left$(lineoftext(cc), spacelocation - 1)
  355.         variableindex = variableindex + 1
  356. End If
  357. nextcc:
  358. Next cc
  359. End Sub
  360. Sub Form_Load ()
  361. 'waiting for sub or function start
  362. 'pull in a line
  363. 'if starts with sub or function, that's our first line
  364. '  store it
  365. 'continue pulling in lines until we get to one that
  366. '  says end sub or end function
  367. 'now go through the whole array we pulled in, and look for
  368. '  dim xx
  369. '  redim xx
  370. '  static xx
  371. ' look for "(" or a space, which gives the end of the
  372. '  variable name
  373. '  can also look for commas, and for
  374. '  commas within parentheses
  375. 'that will give us a list of variables to look for
  376. 'now cycle through the array, looking for variables
  377. 'might want to erase the dim statements after grabbing the
  378. '  variables from them
  379. 'pull in a line.  Ignore the line if it starts with an
  380. '  apostrophe.
  381. 'ignore everything between double quotation marks, including
  382. '  apostrophe's
  383. 'ignore everything after an apostrophe
  384. 'make sure the variable, to be ok, starts the line, or is
  385. '  prefaced by a ( or a space, and make sure it is followed
  386. '  by a , or a ) or a space
  387. 'as variables are found, do something to clear them
  388. doublequote = """"
  389. End Sub
  390. Sub listsubname_Click ()
  391. Dim cc As Integer
  392. listvariablenames.Clear
  393. listunusedvars.Clear
  394. cc = 1
  395. If variable(listsubname.ListIndex, cc, 0) <> "" Then
  396.         listvariablenames.AddItem variable(listsubname.ListIndex, cc, 0)
  397.         
  398.         If variable(listsubname.ListIndex, cc, 1) <> "u" Then
  399.             listunusedvars.AddItem variable(listsubname.ListIndex, cc, 0)
  400.         End If
  401.         
  402.         cc = cc + 1
  403.     Else
  404.         Exit Sub
  405. End If
  406. End Sub
  407. Sub loadlinesoftext ()
  408. 'load into linesoftext the lines that contain the variable declarations.
  409. Dim nextline As String
  410. Dim inasub As Integer
  411. Dim inafunction As Integer
  412. Dim endoffile As Integer
  413. Open filetoopen For Input As #1
  414. subnumber = -1
  415. linesread = 0
  416. more:
  417. 'starting out, subnumber is zero
  418. inasub = False
  419. inafunction = False
  420. If EOF(1) Then
  421.     fileend = True
  422.     linesread = 0
  423.     Close #1
  424.     Exit Sub
  425. End If
  426. Input #1, nextline
  427. linesread = linesread + 1
  428. label1.Caption = Str$(linesread)
  429. label1.Refresh
  430. nextline = Trim$(nextline)
  431. If Left$(nextline, 4) = "sub " Then
  432.         inasub = True
  433.         nextline = Right$(nextline, Len(nextline) - 4)
  434.         GoTo getbody
  435.     ElseIf Left(nextline, 9) = "function " Then
  436.         inafunction = True
  437.         nextline = Right$(nextline, Len(nextline) - 9)
  438.         GoTo getbody
  439. End If
  440. getbody:
  441. 'put the name of the sub or function in variable(sub#,0,0)
  442. Dim thespace As Integer
  443. thespace = InStr(nextline, " ")
  444. subnumber = subnumber + 1
  445. variable(subnumber, 0, 0) = Left$(nextline, thespace - 1)
  446. bodyindex = 0
  447. z% = DoEvents()
  448. If cancelread Then
  449.     Close
  450.     Exit Sub
  451. End If
  452. If EOF(1) Then
  453.     fileend = True
  454.     linesread = 0
  455.     endoffile = True
  456.     Close #1
  457.     Exit Do
  458. End If
  459. Input #1, lineoftext(bodyindex)
  460. linesread = linesread + 1
  461. label1.Caption = Str$(linesread)
  462. label1.Refresh
  463. lineoftext(bodyindex) = Trim$(lineoftext(bodyindex))
  464. If lineoftext(bodyindex) = "" Then GoTo dontuseit
  465. If Left$(lineoftext(bodyindex), 1) = "'" Then GoTo dontuseit
  466. If Left$(lineoftext(bodyindex), 4) = "rem " Then GoTo dontuseit
  467. If inasub And Left$(lineoftext(bodyindex), 7) = "end sub" Then
  468.     Exit Do
  469. End If
  470. If inafunction And Left$(lineoftext(bodyindex), 12) = "end function" Then
  471.     Exit Do
  472. End If
  473. If Left(lineoftext(bodyindex), 4) <> "dim " Then
  474.     If Left(lineoftext(bodyindex), 6) <> "redim " Then
  475.         If Left(lineoftext(bodyindex), 7) <> "static " Then
  476.             GoTo dontuseit
  477.         End If
  478.     End If
  479. End If
  480. bodyindex = bodyindex + 1
  481. dontuseit:
  482. 'now we have linesoftext(), that goes from 0 to bodyindex-1 for one
  483. '  sub or function.  Load into variable() the variable names.
  484. findvariablenames
  485. 'go on to the next sub or function.
  486. If Not endoffile Then GoTo more
  487. End Sub
  488. Sub loadunusedvariables ()
  489. Dim nextline As String
  490. Dim inasub As Integer
  491. Dim inafunction As Integer
  492. Dim endoffile As Integer
  493. Dim linetoevaluate As String
  494. Open filetoopen For Input As #1
  495. subnumber = -1
  496. endoffile = False
  497. fileend = False
  498. more2:
  499. 'starting out, subnumber is zero
  500. inasub = False
  501. inafunction = False
  502. If EOF(1) Then
  503.     fileend = True
  504.     Close #1
  505.     Exit Sub
  506. End If
  507. Input #1, nextline
  508. linesread = linesread + 1
  509. If linesread = 894 Then
  510. End If
  511. label1.Caption = Str$(linesread)
  512. label1.Refresh
  513. nextline = Trim$(nextline)
  514. If Left$(nextline, 4) = "sub " Then
  515.         inasub = True
  516.         nextline = Right$(nextline, Len(nextline) - 4)
  517.         GoTo evaluatebody
  518.     ElseIf Left(nextline, 9) = "function " Then
  519.         inafunction = True
  520.         nextline = Right$(nextline, Len(nextline) - 9)
  521.         GoTo evaluatebody
  522. End If
  523. evaluatebody:
  524. 'now we are evaluating the body of the sub or function, so that
  525. '  if the variables declared locally are found, that variable,
  526. '  variable(subnumber, index, 0)="variablename" can be marked
  527. '  as being used in the sub, by making variable(subnumber, index, 1) = "u"
  528. subnumber = subnumber + 1
  529. bodyindex = 0
  530. z% = DoEvents()
  531. If cancelread Then
  532.     Close
  533.     Exit Sub
  534. End If
  535. If EOF(1) Then
  536.     fileend = True
  537.     endoffile = True
  538.     Close #1
  539.     Exit Do
  540. End If
  541. Input #1, lineoftext(1)
  542. If linesread = 894 Then
  543. End If
  544. linesread = linesread + 1
  545. label1.Caption = Str$(linesread)
  546. label1.Refresh
  547. lineoftext(1) = Trim$(lineoftext(1))
  548. If lineoftext(1) = "" Then GoTo dontuseit2
  549. If Left$(lineoftext(1), 1) = "'" Then GoTo dontuseit2
  550. If Left$(lineoftext(1), 4) = "rem " Then GoTo dontuseit2
  551. If inasub And Left$(lineoftext(1), 7) = "end sub" Then
  552.     GoTo exitloop
  553. End If
  554. If inafunction And Left$(lineoftext(1), 12) = "end function" Then
  555.     GoTo exitloop
  556. End If
  557. If (Left(lineoftext(1), 4) = "dim ") Or (Left(lineoftext(1), 6) = "redim ") Or (Left(lineoftext(1), 7) = "static ") Then
  558.             GoTo dontuseit2
  559. End If
  560. lineoftext(1) = stripquotes(lineoftext(1))
  561. findunusedvariables (lineoftext(1))
  562. dontuseit2:
  563. exitloop:
  564. If Not endoffile Then GoTo more2
  565. End Sub
  566. Function min5 (ByVal x As Integer, ByVal y As Integer, ByVal z As Integer, ByVal a As Integer, ByVal b As Integer)
  567. 'yields the minimum of the five integers, but if an integer=0, then
  568. '  it is not reported.
  569. If x = 0 And y = 0 And z = 0 And a = 0 And b = 0 Then
  570.     min5 = 0
  571.     Exit Function
  572. End If
  573. If x = 0 Then x = 9999
  574. If y = 0 Then y = 9999
  575. If z = 0 Then z = 9999
  576. If a = 0 Then a = 9999
  577. If b = 0 Then b = 9999
  578. If x < y And x < z And x < a And x < b Then
  579.     min5 = x
  580.     Exit Function
  581. End If
  582. If y < x And y < z And y < a And y < b Then
  583.     min5 = y
  584.     Exit Function
  585. End If
  586. If z < y And z < x And z < a And z < b Then
  587.     min5 = z
  588.     Exit Function
  589. End If
  590. If a < x And a < y And a < z And a < b Then
  591.     min5 = a
  592.     Exit Function
  593. End If
  594. If b < x And b < y And b < z And b < a Then
  595.     min5 = b
  596.     Exit Function
  597. End If
  598. End Function
  599. Function stripparentheses (theline As String)
  600. Dim beginparenthesis As Integer
  601. Dim endparenthesis As Integer
  602. Dim beginp As String
  603. Dim endp As String
  604. Dim startlooking As Integer
  605. beginp = "("
  606. endp = ")"
  607. beginparenthesis = InStr(theline, beginp)
  608. If beginparenthesis = 0 Then
  609.     stripparentheses = theline
  610.     Exit Function
  611. End If
  612. endparenthesis = InStr(beginparenthesis + 1, theline, endp)
  613. If endparenthesis = 0 Then
  614.     stripparentheses = theline
  615.     Exit Function
  616. End If
  617. theline = Left$(theline, beginparenthesis - 1) + " " + Right$(theline, Len(theline) - endparenthesis)
  618. End Function
  619. Function stripquotes (theline As String)
  620. Dim beginquote As Integer
  621. Dim endquote As Integer
  622. beginquote = InStr(theline, doublequote)
  623. If beginquote = 0 Then
  624.     stripquotes = theline
  625.     Exit Function
  626. End If
  627. endquote = InStr(beginquote + 1, theline, doublequote)
  628. If endquote = 0 Then
  629.     stripquotes = theline
  630.     Exit Function
  631. End If
  632. theline = Left$(theline, beginquote - 1) + " " + Right$(theline, Len(theline) - endquote)
  633. End Function
  634.